package ThreadDome;

class MyRunnable implements Runnable {

    public void run() {
        int i = 5;
        while(i > 0) {
            System.out.println("hello runable"+Thread.currentThread().getName());
            i--;
            try{
                Thread.sleep(1000);
            }catch(InterruptedException r) {
                r.printStackTrace();
            }
        }
    }
}
public class Dome2 {
    public static void main(String[] args) {
        Thread t = new Thread(new MyRunnable());
        Thread t1 = new Thread(new MyRunnable());
        t.start();
        t1.start();
    }
}
